<template>
<div class="article-page" style="width: 100vw; height: 100vh;">
  <van-nav-bar :title="$t('h.SITE_MESSAGE')" left-arrow  @click-left="$router.go(-1)" />
  <van-cell-group>
    <van-cell is-link  v-for="(article,index) in articles" :key="index" :title="article.title" :label="article.createtime" @click="gotoDetail(article)" />
  </van-cell-group>
</div>
</template>
<script>
import {getArticleList} from '@/api/apiFox';
import {Toast} from 'vant';

export default {
  name: 'pageArticle',
  data() {
    return {
      articles: []
    };
  },
  mounted() {
    Toast.loading({forbidClick: true});
    getArticleList(this.$route.params.ids).then(res => {
      this.articles = res.data;
      Toast.clear()
    })
  },
  methods: {
    gotoDetail(article) {
      this.$router.push({path: '/article-detail/' + article.id})
    }
  },
};
</script>
<style scoped lang="scss">
.article-page{
  .content{
    height: 100%;
  }
}
</style>
